home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / disk_tools / cd32tools / fixsad.asm < prev    next >
Assembly Source File  |  1995-07-12  |  933b  |  32 lines

  1. **
  2. ** Whoah, assembler. i found a hint that the LEVEL-7 interrupt vector
  3. ** is disabled on some machines. this is bad, because you can't trigger
  4. ** the SAD, the SIMPLE AMIGA DEBUGGER. this patch re-enables the SAD.
  5. **
  6. ** if you don't know what a level-7 irq is good for, do NOT use this.
  7. **
  8.     INCDIR    "PROG:Assembler/include"
  9.     INCLUDE    "lib/exec.i"
  10. ;    INCLUDE "exec/memory.i"
  11.  
  12.     MACHINE    68020
  13.  
  14.     SECTION "ASM",CODE
  15.  
  16. Begin    movea.l    4.w,a6        ; call Routine() in Supervisor-Mode
  17.     lea    Routine(pc),a5
  18.     jsr    Supervisor(a6)
  19.     rts
  20.  
  21. Routine    
  22.     movec    vbr,a0        ; get the Vector Base Register (68010++ only)
  23.     moveq    #0,d0        ; set early return code (RETURN_OK)
  24.     move.l    $7c(a0),a1    ; get the LEVEL-7 Vector (NMI)
  25.     cmp.w    #$4E73,(a1)    ; does it point to a RTE instruction ?
  26.     bne.s    Exit        ; no, then return.
  27.     add.l    #2,$7c(a0)    ; correct the vector to the NMI routine.
  28.     moveq    #5,d0        ; warn the user that we've fixed a vector.
  29. Exit    rte            ; end the SuperVisor mode
  30.  
  31.     END
  32.